<template>
  <div>
    <van-nav-bar title="查看疾病部位信息" left-text="返回" left-arrow @click-left="onClickLeft" />
    <div>
      <div class="itemdisease" v-for="(item,index) in diseasecontent" :key="index">
        <div class="name">{{item.name}}</div>
        <div class="ismedicalInsurance">是否纳入医保：{{item.medicalInsurance}}</div>
        <div class="scalias">
          俗称：
          <span v-for="(items,i) in item.alias" :key="i">{{items}}</span>
        </div>
        <div class="infectiousness">
          传染性：
          <span>{{item.infectiousness}}</span>
        </div>
        <div>
          症状：
          <span class="typicalSymptom">{{item.typicalSymptom}}</span>
        </div>
      </div>
      <div style="height: 3rem;"></div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      diseasecontent: []
    };
  },
  created() {
      this.$store.commit("set_bottombar_visible", false);
  },
  // beforeRouteLeave(to, from, next) {
  //   this.$store.commit("set_bottombar_visible", false);
  //   next();
  // },
  mounted() {
    let code = this.$route.query.code;
    this.queryDiseaseListBySite(code);
  },
  methods: {
    onClickLeft() {
      //   this.$toast('返回');
      this.$router.go(-1);
      this.$store.commit("set_bottombar_visible", true);
    },
    async queryDiseaseListBySite(code) {
      //根据关键字搜索对应症状
      let res = await this.$axios.post(
        "/api/common/disease/queryDiseaseListBySite",
        {
          apiKey: "Ib3I1727eb283024b369d60868c8f7b3a719354fd552991",
          site: code
        }
      );
      if (res.statusCode == "000000") {
        this.diseasecontent = res.result.diseaseList;
      }
    }
  }
};
</script>
<style scoped lang="less">
/deep/ .van-nav-bar__content {
  background-color: #0d9df0;
}
/deep/ .van-nav-bar .van-icon {
  color: #ffffff;
}
/deep/ .van-nav-bar__text {
  color: #ffffff;
}
/deep/ .van-nav-bar__title {
  color: #ffffff;
}
.itemdisease {
  font-size: 16px;
  border-bottom: solid 1px #9fd8f9;
  padding: 10px 8px;
  color: #000000;
  .name {
    font-weight: bold;
  }
  .scalias {
    span {
      color: #999999;
    }
  }
  .typicalSymptom {
    color: #999999;
  }
}
</style>